authentication function added tp main program