add change rail function