Fixed all kinds of crashed when no data is returned from the DB