fix: inverted JS functions