Remove this from `gmail_login`. gmail_login should only do the login steps. When you call `gmail_login(user, pass)` then you should already be on the frame you need to be on.