check for length before adding parameters to prevent empty strings