fix db init error, some data communication stuff
use EventEmitter