Added global locking