function that resets locks