Handled error when running with nohup