fixing decoupling of javascript