add check for used keys