What you have works for me. It looks like the error is coming from a different line. Try posting a minimum working example of your problem.
What you have works for me. It looks like the error is coming from a different line. Try posting a minimum working example of your problem.