Added active record functionality