fixed a bug. save databases in DATABASE_ARRAY rather than in DATABASES when databases!=NULL