Error check was added.