Added some input sanitization.