added code for reading email