Added method to check if a key already exists in storage