Almost done javascript bug