remove id only if it exists