fixed bug: wrong string input, suppose array input