Wouldn't it be better to put these context changes inside checkMarionetteOK?