fixed javascript bug causing results not to display