Changed the location of the basic auth code