what is needRestore for?  You only pass if when you pass a lostCallback, so I think you could just omit it.  If you want to leave it in, you need to document it because I don't understand.