corrected port functions in app.js