Finish functionality for login and signup activities