implemented proper resource equality
fixed persistance of associations