make sure that page count is cast to int