fix validation for layers