fixed cast error