fixed NULL pointer exception in stop_all(); added a check for the config file if is really a file