changed acquire_lock to work across entity groups