added lock class to set & release lock