Fix layer selection issue