Add initialize boolean to avoid null pointer exception.