ensuring doc existance before passing to md parser