use null replace nil in document