define db before calling getUser