ADDED FUNCTIONALITY: save new doc with optional custom id