improved check for basic auth