message bug fix, code clean up