Extended the check to consider all db specified by user.