fix error in mail deliver