Fixed database pointed to bug when initializing views