fix memory leak, and upgrade to express 4