error with multiple output functions