fixed unexpected behavior on cascading deletes