added logic for sign in and sign up