cast redirect to a string to avoid simplexml object issue