perfect #572 fix #580 fix #583