check for a valid key also in the store() and remove() methods