fix issue #528 , #517