fixed email handler