fix invalid argument error issue