added javascript to handle batch objects