resolve casting issues with Integer to int