add auto generate html if view exists
use panicOnErr helper function