fix rails mode