added back a check for not empty log