forgot to trim
added reg_cred.go and its test