fixes undefined ids and empty bus routes