added login and update functionality