fixed the bug about the contacts; clear the code of db