testing key exists and with correct key for testing