added check to ensure that only logged in users can vote