fixing new error casting to int