adding exit call to fix hanging issue