fixed nullpointer and implemented firstLaunchDone.