replaced sanitization of pagesize fro ToId to ToInteger