Added better signal handling for linux