Fixed unhandled exception fired  while screensshot is executed. Added boolean flag that indicates fired exception while taking screen shot.