fixing some issues with logging and async