error handling for port