the imap stream by default is 0; therefore check wheter is_numeric is false to check if it is indeed an imap stream