nonexistent ids prevention