fix bug on deletion