added replace function to table