Might be my lack of understanding of coffeescript, but msg is not defined at this point?