closed #470
fixed bugs.