credential validation put into fxn and commented