fix: set class to an element only if it exists (subforms can trigger error)