Error check added.