try to move get_votes and update_votes out of function