bug fix: infinite loop when no rail in game