fixed code and added a page class