made deletes cascade where appropriate, also fixed badge locking for deletes