maybe consider checking type, or catching the class cast exception