fixed bug. add if state
Merge pull request #5 from misa-takeba/master

fix bug