functions to fetch data from devices and block