correcting socket close connection for worker