adding db as a parameter