fixed imlicit cast from long to int warning