added mail, fixed bugs