Fixes an error that would prevent the callback block from being executed on the main thread

Currently the callback block isn't executed on the main thread. This fixes that.