fixed delete-function