fix bugs of input