fixed cast stuff