issue #736
handled some errors of the database connection