check if vote is valid before handling it