added error handling to port input