add compare for async and sync