fixed bug #640