added type checking for Die