type validation on inputs