fix issue 355 & 363