Fix memory issue with console log