fix apex to use stdin redirect