Fixing issue with text and url directive when input wasn't a string