improved call-back logic and error handling
Merge pull request #137 from georgebyelas/master

improved call-back logic and error handling