return 0 as the value of error