some more attempts to get the js functional