Attempt to fix restarting using boolean flags