javascript add and delete working