moving authentication alert to main thread