fix a bug of hw3