Fix bug on database selectDB method