updated the code for latest express version
minor changes