fix compare in asynchronous method