Add write callback
Merge pull request #4 from fbbdev/pull-request

Add write callback