listen for clients in local env
catch error event to prevent from crash