fix bug #321