first working asynchronous version, need to refactor