extend usage of string variable and bug fix