New func getMsgByExtent