fixed references and set up loginviewcontroller