Fixed javascript delete problem