fixed bug for in=out