Added better error handling for non-existant tables