added lock file support.