add exception for wrong primitive type