fixed error code, added catting to email