cast to int in error