I believe the problem is this:When the connection is slow, you are trying to sort the page before it has all loaded, which causes an error (II suspect).