fix a return value bug