add exit(0) to force application exit