fix js bug in relasiation