I might have lost it

. So, on top of adding the state of the user, I also want to have a section for leaders, that once they log in, they can see more functions, leader meetings etc etc. I got the login system working fine, the only issue is making sure the app remembers it

. It's probably something small, but I can't quite see what's wrong

. I have a login button with this code:
on mouseUp
ask password "If you are a leader, you can log in here." with "" titled "Leader login"
put it into loginans
put "leaderstate" into leaderstate
put url {dropbox link} into leaderpassword
if loginans=leaderpassword then
answer "Thank you for logging in!"
put true into leader
{appropriate dropbox event text files}
savePref leaderstate,true
delete stack "myPrefs"
else
answer "Sorry, that's not the password!"
end if
end mouseUp
on savePref pPref,pValue
put specialFolderPath("documents") & "/MyPrefs.lc" into tPrefsFile
create invisible stack "myPrefs"
set the filename of it to tPrefsFile
set the pPref of stack "myPrefs" to pValue
save stack "myPrefs"
end savePref
It all works perfectly... Until I open the app again next time. Once I do, it seems to have forgotten the default state from before

. If I then choose a new state, it forgets the leader status

. I've even got this on my splashscreen:
go invisible stack tPrefsFile
put the defaultstate of stack "myPrefs" into state
put the leaderstate of stack "myprefs" into leader
delete stack "myPrefs"
It works until it has to remember the default state and whether the user is a leader or not

. And here I was thinking I got the whole savepref thing
