fix descriptor problems