fixing ui thread
adding checking of assumptions