error management + db ok