fixing start up crash when running with supervisor