Updated conditional logic to apply css class.