improve error messaging