JS hook to clear/new