fix exception and remove logging