Fixing issue with assigning datatype