resolve the two bugs