Bugfix for delete method