fixed issue#1 issue#3