Update main.js

Replaced #3 which was overwritten by #4
Merge pull request #6 from gevious/patch-1

Update main.js