replace tep_session_is_registered() with isset()