Fixes crash caused by moving the search tab to the first position, and fixes data disappearing when changing tabs