Fixed issue with getting data from the database.