Added str in db connection to avoid possible unicode issues.