rewrote on msg, fix indentation error