changed the usage of db