removed unused js
added guard