adding debug statements
correcting pagination issues