fixed issue where binding value to sql statement was failing due to improper relationship handling