fix sorting friend and registration