Biosynthesis of Ag and TiO2 nanoparticles and the evaluation of their antibacterial activities