fix a bug cause by wrong data types