add loading and error messages