fix data casting