execute generator function bug fix