fixed logic bug with pausing threads and some other updates