fixing some authorization logicz