Modified code to fit express 3.4 status quo better