Added debug option auto reconnect for the database connection and fixed db error handling