Fix issue with active record