fix bug when there is only one input