fixed some input bugs