fixed some erros with input