implement document behaviors