add more conditional styling in controller function