More secure fix for xss issue