fix some known bug and fix the interface