fix the data attributes
remove nesting in the where clause