Fixed issue with callback not allways being called