updated with typed errors