added initial lock check