placed html fetching lines inside try except block for error handling