Added custom stderr handler to restart phantom if it crashes