Fixed bug with authetication