added yellow and red borders when needed