layer selection bug fix