add double fork and fix monitor script