added id check for the delete call