fixed active record issues