Improve task limit js condition