added a custom PreviousTab function