fix layer tooltip error, and error resulting in wrong layer selected