added global switch for db