bug fix for output