var replacement fix