improve error message
fix coding style and grammar