Fixing issue with relations