Improve error handling when running on used port