fix bug for input