changed db variable name to data