correct error handling and data source of hw1
hw2-2 done