Updated Unlock Function