added error handling
more error handling
modifying html