improved error checking in view builder