added login url and nsuserdefault code - not working though!!