a minor code cleaning
fixed some fatal bugs about operation