Fix the javascript that deletes resources