Added gameRunning condition to update method