Fix logic for existing conditions