ajax working, but need to refactor to pass data with the call