Run groovy code on main thread