fix ported eend function return value