modify to fit webapp2 standard