remove appinn and free ^N/^P for next-thread/prev-thread