handling int and long gracefuly