add auto locking behaviour