added doc handling