Small fix for running with express 4. Need to reimplement for optimization in express 4.