fix locking in background