layer.js minor bugfix