Bug fixing, ensuring db is loaded properly