fix bug with requesting id from undefined