Added logic if env.PORT is unavailable.