Modified widget js behaviour