add authentication function