before unlock script