added code for credentials verification (experimental)