small edit to ensure no index out of bounds exception when parsing pasted string.