fixed issue with file locking