adding async loop and sync loop