update all_keys method to properly sort