removed some bugs in engine on mail