make cascade delete work
fix an incorrect usage of foreach