implemented global lock