bug fixes with delete and protected relations