added error check if cannot deliver
changed link in email notification to localhost temporarily