changed code to convert string to bytes