Fixed crashing after rebuilding the view