Added error checking again.