add contextMenu

add contextMenu and fix some bugs