updated lock and unlocking for levels