assign input string in struct not working