fix placement of style change so that it is conditional on data