making script output info when login fails...+ refactored the operations a bit