Adds query and variable for checking whether a user has previously voted.