fixed cast to int