added more security to main JS file