implemented vote method in view.