Added input sanitization.