fixed throw error when key doesn't exist