fixed activerecord error