fixed problem with delete relations