refactored js inclusion to avoid script caching problem