added stuff mainthread, need to test!