fixed invalid output handler