modified authenticate