adding log in functionality