Added logging an error