resolving issues with update and delete ajax functions