fix javascript bug