change to active record