minor fixing with msg logging function