Fix delete layer error