Dirty hack to make an asynchronous operation synchronous.