Added log in functionality