re-adding the cast check