fixed some print logic