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

clean up and bug fix