Does it give you a 500 error with the stock script in place? If not, then it's probably a syntax error somewhere with the modification.