better handling for logs