added auxiiary function retrievepollbyid