adding in context generation as thread