Fixing issue with lockedby not being defined