fix two bugs

these two bugs occured the first time when i run this project