added mutex.
mutex is near to be finished