still dealing with page funciton and poor ejs