fixed read function not accepting input/output ports