Prevents callbacks being called multiple times

#18 causes the callback handler to be called multiple times if an error occured.
Merge pull request #23 from eric-wieser/patch-1

Prevents callbacks being called multiple times