locking macro