added some security features to auth script