fix duplicate class attribute bug