fix if condition to check current tab page number