Replaced usetestdb with global variable