fixed deletion functionality