fix bug false interpretation of return value