fixed tag code to handle special characters (+,#, etc)