Used an async method where a sync method was required.