fixed not outputting correctly