added some basic validations on type