Delete element buttons always applying to the correct element