some optimize
some fix
new version for message transfer