javascript tagging bug fix