Added input sanitization