making changes to update to be ajax as well