fix port erb for hash sort