working logout + login with coredata