clean up and bug fix
Merge pull request #12 from xduo/staging

clean up and bug fix