Fixed crash

Fixed crash when setting the port to a non numeric value