fix issues #1,#2