added locking