implemented database downloading