change deadlock javascript