Added to authorization - can now get keys when called from main function.