fix dbconnection bugs
Deleted old memory_db
merge memory_db