bug fix and mail notification