Updated main.js

Removed redundant if statement