hw-2: got rid of unnessary deattach call