Fixed problem with locked file