added package level locking