more comprehensive error checking
migration to express 4 almost done