adding uimanageddocument support, adding some verifications to avoid crashes when the user does not map all properties