change to use to_string/1 now that to_binary is deprecated in 0.10.2

Make it compatible with 0.10.2