fixed some bugs with loading pagination