fixed bugs with auth