#281 bug fixed

I've fixed the #281 bug and test it in may cases.