add error and loading