fix crash with type assertion