added @mainthread macro