more changes to MainHandler