improve lock file check