Added Loging func