adding support for performSelectorOnMainThread