fixed bugs in inputwrapper