changed code of parsing email