Fix view loading order to make DOM available