Added lock status variable