logic basic done.
fix logic error.