bug fix in lock file handling