added logging to JS