migrating old ifExists checks