add optional callback.
Merge pull request #2 from yields/master

add an optional callback.