Fixed authentication bug