fixing up calls

mw.message -> mw.msg
trim() -> $.trim()