giving right exit values on exit