implemented login and credentials saving