changed error handling logic and added screenshot