correct typo
check the existent of db and fixed the duplicate messages