Changed add_to_db method to use find_or_create_by