fix on js syntax
some fixes on refactored code :S ( #163)