fixes error when passing in non ascii chars