some bug fixes for hw7