Hacky threading fix