put in some safegaurds to avoid home page not loading when db data missing