return if document not defined