backup old authentication function