updating with exception handling