error handling changed need to test
moved pic