added check if insert string is empty