renaming a => p in messages system, and fixing bug where messages werent decoding properly