Undefined h in function copy_doc

Fix bug when h is not defined