fixed javascript bug in stats