Fixed authentication script bug