fixed authorisation bug