cast to int, fixing warning