added parameter in function to fetch specific state responses