fixed bug in associate_to