Variable checks for delete in layers.js