add additional check to prefent exeption in save screenshot