improve "Exit" function and run OSMCore function