updated version 1.0.1, fixed some bugs and refactor