adding exit() method to stop script execution