fixed input bugs