Fix moving tabs and crash from previous fix

Fix moving tabs and crash from previous fix