fix bug with optional view loading