fixed the input bug