Adding check for program.blank?

Fixes issue where there are no programs present in the db.