added basic message handling and more patch management