add verbose error handling