set exit code properly & improve error and other messages