custom repository class problem