Getting ajax insert to work properly