Fixing id bug