replaced use of session
no need to set lastPage anymore