public static StompFrame factory(String wholeMessage){
		HashMap<String, String> headers=parseHeaders(wholeMessage);
		if (headers == null)
			return ErrorFrame.factory(wholeMessage, "cannot read headers");
		if (headers.get("destination") == null)
			return ErrorFrame.factory(wholeMessage, "invalid subscribe: no destination entered");
		if (headers.get("id") == null) 
			return ErrorFrame.factory(wholeMessage, "invalid subscribe: no id entered");
		return new SubscribeFrame(wholeMessage);
	}