Add file locking duaring resizing