add hasError in Metadatabase.java