added better string handling