use of getter from database to print, no print directly from database. fix the memory leaks
cleaning