Merge pull request #11 from vkuznetsov/master

correct behavior of callbacks