minor reworks/ added credentials validation