moved callback to main thread