bug fixes and mailing error to admin