Updated to check if running on Heroku for port setting