broken code, authentication doesnt work randomly