async and sync example