Add a lock(mutex) for receiving data