changed to use ajax calls