handle key not found error