try substr catch