fixing rails mistakes