fixed cast class exception