Fix logic for displaying segments