ajax commit and delete working