uses main thread instead of current thread to avoid compiler warnings; for my purposes they are equivalent anyway