some little changes to fix bug