move perPage var to the inside of the project function.