rewrite check command, handle error properly.
Merge pull request #12 from spin6lock/rewrite_check

rewrite check command, handle error properly.