Fix bug where imap turned off