modify some code about output port