fixed type mismatch
Refactored for paho
on_message fix and rewritten for local mosquitto server