add logging to js