fix class cast