Thank you! It seems to work, but I don't understand why it works for a form but not a class.