updated to use jquery ajax calls