added new code for live imaging