removed call to exit during removal to prevent blocked removalin core and put case statement in else statement