exit scripts on error + fix database setup