Fixed bug at logging