fix the loop on terminal generate by grunt task