fix bug: add type cast
basic working