fixing document handler