id tag parsing improved