upgraded to activerecord