catch error when listening to tcp port
sanitize the inputs