Added the logic of signin & singout.