added credential validation