js fix for sort links