adding in error states