ensure that all callbacks blocks are called on main thread