Added logging and cascade delete