Adding log in functionality and user validation.