Added conditional layer drawing