fixed bug in input sanitization