returning id bug fixed