file locking/unlocking separated