fixing hanging authentication