exit code functionality added