fix get_prev_entry and get_next_entry crash