fixed bugs after upgrade to express 4