Creating message handler and add logging