Added error testing