exit 1 improvement and some changes