fixed minor javascript prototype bug