added a basic auth func