sort hashes to prevent shuffling and restarting ssh unnecessarily