draw layer whenever mode is changed