working logic for viewing surveys