fixed pagination problems