fixing closing on client request