added more code for live imaging