set ret value in -1 case