upgrade flag of key