Fixed bug where log msg was printing the wrong variable