Make asynchronous method renderSceneAsync to work without errors, connected with threads