using domain to trap errors in different parts of application