fix sorting by move orderBy to the end of the directive