changing  call to an ajax call