add Deactive method and fix some bugs