Added code for mutex