update to use js ajax call