fixed "capture" bug, where id were always "undefined"