Fix broken refactor

Message argument was called as msg in the function body.