add function to fetch result