Revert "bug fixs"

This reverts commit 823fe731e8b1ec4bf807b356ed8fac606845ee9c.