I don't see any text output reversed when the script is turned off.
What is the error message you've received in query? Does it still work in query for you?