added boolean for switching between content provider and not in populating the database function