added GCD macro to safely run a block on the main queue