screenshot before browser close