Added real time data function and error messaging