Queue print by function fixed