check the type on spawning and cast accordingly.