refactoring of commonDB: introduction of error and catch