add function for conditional styling