this is what i went with to fix it up
Your fix is not correct. For example, it assumes that $POST['search_box'] exists, but that is not guaranteed. If $SESSION['search'] is set, there is self-assignment, which is silly. It also assumes $_GET['search'] exists, but that is also not guaranteed.