some fixes with train