better set the "undefined" value before return