fixed condition order_by not applied when running a related query. closes #254