fixed a bug where the config file could get locked forever