you are reading the username and password from a file. thus line ends whit new line
\n
. you need to strip that new line or your password (details[1]) will not match, i.e. you expect it to be letmein222
, but it is letmein222\n