fixed problem with double callback when the port was not available