fix for incorrect return code