init document variables
check for null object