added user authentication code