improved delete behaviour