fixed bug with output