added debugging to updatedb method