Method for executing function after unlock