Added background and error handling