Fixed the table sort javascript