handle exceptions for database creation