Threading successfully tested
fixed all errors