Async patch

Rewrote to use async functions everywhere and added a log message.