get database settings does not access global variables correctly