fixed sanitization of last input