If password is invalid, program gets stuck in an infinite loop where PhantomJS requests a page it doesn't have access to.