function called "locked"