Check lenght of string before trying to use parameters