added some exceptions blocks when trying to get data in case there is a database problem