fix delete

Pressing DELETE will now work properly and also not segfault.