added logging to js