$db is not defined

Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>