added logic for data type casting