fixed the problem with no. of inputs