cleaned up the imap client