change set_focus logic