added mutex lock