fixing conditional in main js