adding error catch for screenshot