Added logic of login