bug fixing for loging