repair function IN/OUT

repair function IN/OUT