Fix bug of #12 #282 

fix bug #282 #12