Added background mode and logging error for failure