Fix javascript eror redirecting to new notes