fixed null issue on delete