[BUGFIX] Fix wrong code with JavaScript deletion