changed data types and made check type var local.