fixed alert formatting for spans in a better way