add errors directory and some minor fix