Added test for length of string so that don't throw error when lenght is 0